package com.fordmotor.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;
import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter;
import org.springframework.security.oauth2.config.annotation.web.configurers.ResourceServerSecurityConfigurer;
//import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;

//@Configuration
//@EnableResourceServer
public class ResourceServerConfig extends ResourceServerConfigurerAdapter {

    private static final String RESOURCE_LBS = "lbs";
    private static final String RESOURCE_COUNT = "count";
//    @Override
//    public void configure(ResourceServerSecurityConfigurer resources) {
//        resources.resourceId(RESOURCE_LBS+","+RESOURCE_COUNT).stateless(true);
//    }
//
//    @Override
//    public void configure(HttpSecurity httpSecurity) throws Exception {
//        httpSecurity
//                .authorizeRequests()
//                .antMatchers("/"+RESOURCE_LBS+"/**").authenticated()
//                .antMatchers("/"+RESOURCE_COUNT+"/**").authenticated();
//                //配置资源访问控制，必须认证过后才可以访问
//
//    }
}
